#include "Arduino.h"
#include "zk_os.h"
#include "hal_oled_ssd1327.h"
// #define QUEUE2_DEMO_ENABLED 
// #define WEB_DEMO_ENABLED
// #define WEB_TIME_DEMO_ENABLED
// #define LUA_DEMO_ENABLED
#define ZK_OS_ENABLED

#include <global_config.h>

Adafruit_SSD1327 display(128, 128, OLED_MOSI_PIN, OLED_SCK_PIN, OLED_DC_PIN, OLED_RST_PIN, OLED_CS_PIN);

void setup(){
    Serial.begin(115200);
    Serial.println("ZK OS DEMO");
    #ifdef QUEUE2_DEMO_ENABLED
    queue2Demo.init();
    #endif
    #ifdef WEB_DEMO_ENABLED
    webDemo.init();
    #endif
    #ifdef WEB_TIME_DEMO_ENABLED
    webTimeDemo.init();
    #endif
    #ifdef LUA_DEMO_ENABLED
    luaDemo.init();
    #endif

    #ifdef ZK_OS_ENABLED
      zkOS.init();
    #endif        
    Serial.println("ALL DEMO initialized!");
}
 
void loop(){
  // webTimeDemo.update();
  #ifdef LUA_DEMO_ENABLED
   luaDemo.update();
  #endif
  delay(1000);
}